<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
   ul li{
      list-style: none;
      float: left;
   }
   
</style>
</head>
<body>
   <h3 style="color:green">${msg}</h3>
    <form action="${pageContext.request.contextPath}/file/uploadImg"  method="POST"
      enctype="multipart/form-data"
    >
      文件: <input type="file" name="file"/>
      <input type="submit" value="上传"/>
    </form>
<%--   
     ${pageContext.request.contextPath}/--> /mvc-demo02/
      ${pageContext.request.contextPath}/uploads/${url}
      /mvc-demo02/uploads/上传文件的目录名称 (.txt .jpg .xx)
      静态资源到物理目去找 
      --%>

  <c:if test="${not empty url}">
     <img  src="${pageContext.request.contextPath}/uploads/${url}" width="200"> 
  </c:if>
  <hr/>
  <form action="${pageContext.request.contextPath}/file/uploadFiles" method="POST"
       enctype="multipart/form-data"
  >
    <input type="file" name="files" multiple/>
    <input type="submit" value="上传"/>
  </form>
  <hr/>
   <form action="${pageContext.request.contextPath}/file/uploadImages"  method="POST"
     enctype="multipart/form-data"
   >
      <input type="file" name="imgs" multiple/>
      <input type="submit" value="上传图片"/>
   </form>
  
   <c:if test="${urls!=null }">
     <ul>
       <c:forEach items="${urls}" var="url">
         <li><img width="120"
          src="${pageContext.request.contextPath}/uploads/${url}"/></li>
       </c:forEach>        
     </ul>
   </c:if>
    
</body>
</html>